home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Your Choice 1
/
your choice.zip
/
your choice
/
PRGMMING
/
RASTERS
/
RASTERS.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1994-01-07
|
8KB
|
254 lines
Program Rasters;
Uses Crt;
Const MaxRasters = 895;
Var Rastercolors : Array[0..MaxRasters,1..3] Of Byte;
Teller : Integer;
ByteTeller : Integer;
ColorTeller : Integer;
Speed : Integer;
ValCode : Integer;
Ch : Char;
Label Loop;
{---------------------------------------------------------------------------}
Procedure Title;
{ Just to show a title... }
Begin
Writeln;
Writeln('Rasterbars v1.0 by Eric van der Staay - Rasters /h for help!');
Writeln;
End;
{---------------------------------------------------------------------------}
Begin
Delay(100);
{---[ Initialise default bar-speed (going down with speed 1) ]---}
Speed:=-1;
{---[ Determine if parameters are given ]---}
If ParamCount>0 Then
Begin
{---[ Help! ]---}
If (ParamStr(1)='/h') Or
(ParamStr(1)='/H') Or
(ParamStr(1)='/?') Then
Begin
Title;
Writeln('Syntax...: Rasters [Speed]');
Writeln('Example..: Rasters 3 - Goes up with a speed of 3');
Writeln(' Rasters -2 - Goes down with a speed of 2');
Writeln;
Writeln('You can use this for a background of an ansi... ');
Writeln('Just show the ansi first and then run this program!');
Writeln;
Writeln('If you want a nice advertisement for your BBS or you want me to code a crack');
Writeln('intro for you or your group, then write to:');
Writeln;
Writeln(' Eric van der Staay');
Writeln(' IJweg 133a');
Writeln(' 1161 EV Zwanenburg');
Writeln(' Hollland');
Writeln(' ++31(0)2907-2039');
Writeln;
Writeln('If you''re into Assembler and Pascal source swapping, don''t hesitate to write!');
Writeln;
Halt(1);
End;
{---[ Speed as parameter ]---}
Val(ParamStr(1),Speed,ValCode);
If ValCode<>0 Then
Begin
{---[ Hey! Illegal speeds! ]---}
Title;
Writeln('Illegal bar speed!');
Writeln;
Halt(1);
End;
End;
{---[ Disable interrupts for smooth scrolling bars... ]---}
Port[$21]:=1;
{---[ ColorCounter (Teller=Counter in Dutch) ]---}
ColorTeller:=0;
{---[ *** Initialise different colorbars *** ]---}
{---[ Bar 1 (Red) ]---}
For ByteTeller:=0 To 63 Do
Begin
RasterColors[ColorTeller,1]:=ByteTeller;
RasterColors[ColorTeller,2]:=0;
RasterColors[ColorTeller,3]:=0;
ColorTeller:=ColorTeller+1;
End;
For ByteTeller:=63 DownTo 0 Do
Begin
RasterColors[ColorTeller,1]:=ByteTeller;
RasterColors[ColorTeller,2]:=0;
RasterColors[ColorTeller,3]:=0;
ColorTeller:=ColorTeller+1;
End;
{---[ Bar 2 (Green) ]---}
For ByteTeller:=0 To 63 Do
Begin
RasterColors[ColorTeller,1]:=0;
RasterColors[ColorTeller,2]:=ByteTeller;
RasterColors[ColorTeller,3]:=0;
ColorTeller:=ColorTeller+1;
End;
For ByteTeller:=63 DownTo 0 Do
Begin
RasterColors[ColorTeller,1]:=0;
RasterColors[ColorTeller,2]:=ByteTeller;
RasterColors[ColorTeller,3]:=0;
ColorTeller:=ColorTeller+1;
End;
{---[ Bar 3 (Blue) ]---}
For ByteTeller:=0 To 63 Do
Begin
RasterColors[ColorTeller,1]:=0;
RasterColors[ColorTeller,2]:=0;
RasterColors[ColorTeller,3]:=ByteTeller;
ColorTeller:=ColorTeller+1;
End;
For ByteTeller:=63 DownTo 0 Do
Begin
RasterColors[ColorTeller,1]:=0;
RasterColors[ColorTeller,2]:=0;
RasterColors[ColorTeller,3]:=ByteTeller;
ColorTeller:=ColorTeller+1;
End;
{---[ Bar 4 (Yellow) ]---}
For ByteTeller:=0 To 63 Do
Begin
RasterColors[ColorTeller,1]:=ByteTeller;
RasterColors[ColorTeller,2]:=ByteTeller;
RasterColors[ColorTeller,3]:=0;
ColorTeller:=ColorTeller+1;
End;
For ByteTeller:=63 DownTo 0 Do
Begin
RasterColors[ColorTeller,1]:=ByteTeller;
RasterColors[ColorTeller,2]:=ByteTeller;
RasterColors[ColorTeller,3]:=0;
ColorTeller:=ColorTeller+1;
End;
{---[ Bar 5 (Purple) ]---}
For ByteTeller:=0 To 63 Do
Begin
RasterColors[ColorTeller,1]:=ByteTeller;
RasterColors[ColorTeller,2]:=0;
RasterColors[ColorTeller,3]:=ByteTeller;
ColorTeller:=ColorTeller+1;
End;
For ByteTeller:=63 DownTo 0 Do
Begin
RasterColors[ColorTeller,1]:=ByteTeller;
RasterColors[ColorTeller,2]:=0;
RasterColors[ColorTeller,3]:=ByteTeller;
ColorTeller:=ColorTeller+1;
End;
{---[ Bar 6 (Light-Blue) ]---}
For ByteTeller:=0 To 63 Do
Begin
RasterColors[ColorTeller,1]:=0;
RasterColors[ColorTeller,2]:=ByteTeller;
RasterColors[ColorTeller,3]:=ByteTeller;
ColorTeller:=ColorTeller+1;
End;
For ByteTeller:=63 DownTo 0 Do
Begin
RasterColors[ColorTeller,1]:=0;
RasterColors[ColorTeller,2]:=ByteTeller;
RasterColors[ColorTeller,3]:=ByteTeller;
ColorTeller:=ColorTeller+1;
End;
{---[ Bar 7 (White) ]---}
For ByteTeller:=0 To 63 Do
Begin
RasterColors[ColorTeller,1]:=ByteTeller;
RasterColors[ColorTeller,2]:=ByteTeller;
RasterColors[ColorTeller,3]:=ByteTeller;
ColorTeller:=ColorTeller+1;
End;
For ByteTeller:=63 DownTo 0 Do
Begin
RasterColors[ColorTeller,1]:=ByteTeller;
RasterColors[ColorTeller,2]:=ByteTeller;
RasterColors[ColorTeller,3]:=ByteTeller;
ColorTeller:=ColorTeller+1;
End;
{---[ Bytecounter for colorcounter step -> makes scrolling bars ]---}
ByteTeller:=0;
Repeat
{---[ Start of rastercolors array ]---}
ColorTeller:=ByteTeller;
Loop: Port[$3c8]:=0; { Color 0 (Background) }
Port[$3c9]:=RasterColors[ColorTeller,1]; { Init colors RGB }
Port[$3c9]:=RasterColors[ColorTeller,2];
Port[$3c9]:=RasterColors[ColorTeller,3];
Inc(ColorTeller); { Increase colorcount }
If ColorTeller>MaxRasters Then ColorTeller:=0; { Limit }
{---[ Check last scanline ]---}
Asm
Mov Dx,$3DA
In Al,Dx
Test Al,8
Jz Loop { Zero (JZ)? Jump loop }
End;
{---[ Not Zero (vertical retrace) ]---}
ByteTeller:=ByteTeller+Speed; { For scrolling }
If ByteTeller>MaxRasters Then ByteTeller:=0; { Limits }
If ByteTeller<0 Then ByteTeller:=MaxRasters;
Until Port[$60]<$80;
Port[$3c8]:=0; { Original (black) background }
Port[$3c9]:=0;
Port[$3c9]:=0;
Port[$3c9]:=0;
Port[$21]:=0; { Enable interrupts }
End.